package com.jinxi.demo.controller;


import com.jinxi.demo.pojo.entity.TabCommodity;
import com.jinxi.demo.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("")
public class DemoController {

    @Autowired
    private DemoService demoService;

    @RequestMapping("/commodities")
    public String commodities() {
        List<TabCommodity> allCommodities = demoService.getAllCommodities();
        return allCommodities.toString();
    }
}
